%% ===========================================================================
%% 
%% Installation configuration settings
%% 
%% Set to appropriate values before installing the system.
%% The defaults listed are suggestions and/or the ones used for local 
%% installation in the CLIP group machines.
%% ===========================================================================
:- module(_,_,[functions]).
:- use_module(library(terms), [atom_concat/2]).
:- use_module(library(system)).
:- use_module('../configuration').
%% ===========================================================================

%% WebDB instance name. Do not edit,
webdbname := ~wdbn .

%% Define your Operating System Architecture
% os := 'Win32' .
os := 'Unix' .

%% Directory where the database server will publish its address.  Do not edit.

dbadd := ~add.

%% Same for logs.

dblog_dir := ~log_dir.

%% HTTP accessible directory to hold the database consulting/maintenance pages 
dbhome := ~atom_concat([~root_dir, '/', ~webdbname]) .
% In windows, e.g. dbhome := '/cygdrive/c/public_html/LocalWebDB_TEST' .

%% Via HTTP db admininistration directory
dbadmin := ~atom_concat([~dbhome, '/admin']) .

%% URL of the previous directory
dburl := ~atom_concat([~root_url, ~webdbname]) .

%% Base directory for the data, types and description files. By default 
%% it's set to DBHOME but for more security and prevention of undesired 
%% downloading change it to some directory which is not under DBHOME

%dbdatadesc := '/home/clip/var/webdb' .
dbdatadesc := ~dbhome .

%% Directory to install the html templates of the system graphical environment
dbtemplates := ~atom_concat([~dbhome, '/html_templates']) .

%% Legacy AMOS templates 

amos_templates := ~webdb_templates .

%% This the location of the AMOS database. In a future it could point to a SQL 
%% database 
dblocation := ~atom_concat([~dbdatadesc, '/amos_db']) .

%% CSS URL
db_css := ~atom_concat([~css_url, 'amos.css']) .

%% Amos admin/ reviewer email
reviewer_email := ~amos_email.

%% Directory to install the Ciao engine
%% ciaobin := '/home/clip/Systems/WebDB/' .
ciaobin := '/usr/local/bin' .

%% ----------------------------------------------------------------------------
%% These can be left as is but are provided for customization
%% ----------------------------------------------------------------------------
%% IMPORTANT: the following three directories MUST have write permission
%% for the user under which the httpd is run (typically "nobody").
%% 
%% Directory to keep the database description files
dbdesc := ~atom_concat([~dbdatadesc, '/db_desc']) .

%% Directory to hold the database files.
dbdata := ~atom_concat([~dbdatadesc, '/db']) .

%% Directory to hold the database types.
dbtypes := ~atom_concat([~dbdatadesc, '/db_types']).

%% The Ciao compiler
ciaoc := 'ciaoc-1.10' .
% In windows: ciaoc := 'ciaoc.bat' .

%% The lpmake tool.   WARNING: IT HAS TO MATCH THE ONE IN ../COMMON!!!
lpmake := 'lpmake-1.10'. 

% In windows: lpmake := 'lpmake.bat' . 

%% ----------------------------------------------------------------------------
%% ------------- SETTINGS FOR THE DISTRIBUTION MAKEFILE ONLY ------------------
%% ----------------------------------------------------------------------------

%% ----------------------------------------------------------------------------
%% This is where the source lives
%% 
src := '/home/clip/Systems/WebDB' .
%% ----------------------------------------------------------------------------
%% This is where the ciao sources live 
%% 
ciaosrc := '/home/clip/Systems/ciao' .

ciaohome := '/home/clip/Systems/ciao' .
%%  This is so that we report correctly with which version it was compiled
%% engine := ciao-`cat ${CIAOHOME}/version/GlobalVersion`\#`cat \
%%                  ${CIAOHOME}/version/GlobalPatch`

%% ----------------------------------------------------------------------------
%% Define this to be the directory in which you want the executable installed. 
%% bindir := /usr/local/bin' .
 
bindir := '/home/clip/bin' .
%% ----------------------------------------------------------------------------
%% Define this to be the directory in which you want libraries to be installed.
%% libdir := '/usr/local/lib' .

libdir := '/home/clip/lib' .
%% ----------------------------------------------------------------------------
%% Define this to be the dir in which you want all docs installed. 
%% DOCDIR= /usr/local/doc

docdir := '/home/clip/public_html/Local/lpdoc_docs' .
%% ----------------------------------------------------------------------------

%% Set here the group under which dbserver will run. The user who
%% performs the installation should have read and write rights for
%% this group. Also, the web server should be able to honor the setgid
%% bit in the dbserver executable.

dbserver_group := ~www_group .

%% Define this to be the permissions for installed execs/dirs and data files.

%% Local password file "admin/password.pl" permission. For security reasons, 
%% keep it unreadable:
passwdperms(perm(w, '', '')) .
%% Permissions used for WebDB's log file, "admin/dbserver.log":
dbserverlogperms(perm(rw, rw, rw)) .
%% Permissions used for web accesible directories/files:
%% "admin"
%% "~dbadd"
%% "~dbdata/dbserver"
%% "~dbdesc/dbserver"
webdirperms(perm(rwx, rx, rx)) .
%% Permissions used for WebDB's front pages:
%% "admin/maintenance.html"
%% "index.html"
frontpageperms(perm(rw, r, r)) .
%% Permissions of WebDB's executables files and scripts:
webexeperms(perm(rwx, rx, rx)) .

%% ----------------------------------------------------------------------------
%% END
%% ----------------------------------------------------------------------------



